/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.LoggedData;

import java.util.Date;

/**
 *
 * @author DOStudent1
 */
public class LogableDate implements LogableObject {
    
    private Date date=null;
    private boolean isSet=false;
    
    public LogableDate() {
    }
    
    public LogableDate fromDate(Date date) {
        LogableDate res=new LogableDate();
        res.date=date;
        res.isSet=true;
        return(res);
    }

    
    public boolean isSet() {
        return(isSet);
    }
    
    
    
    public Date getDate() {
        if (!isSet) {
            throw new RuntimeException("Not initialized");
        }
        return(date);
    }

    public LoggedLogableObject toLoggedMyObject() {
        LoggedLogableDate loggedMyNumber=new LoggedLogableDate();
        return(loggedMyNumber.fromLogableObject(this));
    }

    public boolean isEmpty() {
        return(date==null);
    }


}
